
router.beforeEach(function(to, from, next) {
	//没token就肯定没登录, 有firstPath就肯定有登录
	var token = tool.getItem("token");
	var firstPath = store.state.firstPath;
	
	//没有登录,并且不是去登录页
	if(token==null && to.path != "/login") {
		//跳转至登录
		router.push("/login");
		
	//有登录,但是去登录页
	} else if(firstPath && to.path == "/login") {
		//跳转至菜单首页
		router.push(firstPath);
		
	} else {
		next();
	}
})